package demo7;

import java.util.concurrent.TimeUnit;

public class SingleTonLazy {
    private static volatile SingleTonLazy instance=null;
    private SingleTonLazy(){}
    public static  SingleTonLazy getInstance(){
        if(instance==null) {
            synchronized (SingleTonLazy.class) {
                if (instance == null) {
                    instance = new SingleTonLazy();
                }
            }
        }
        return instance;
    }
}
